<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let arr = [
        { name: 'test_1', age: 11 },
        { name: 'test_2', age: 12 },
        { name: 'test_3', age: 13 },
      ]
      let newArr = arr.map((item, index) => {
        let nameArr = item.name.split('_')
        if (item.name == 'test_2') {
          return {
            ...item,
            name: `${nameArr[0]}_${Number(nameArr[nameArr.length - 1]) + 1}`,
            age: 1000,
          }
        } else {
          return {
            ...item,
            name: `${nameArr[0]}_${Number(nameArr[nameArr.length - 1]) + 1}`,
            age: 999,
          }
        }
      })
      console.log(newArr, arr)
    </script>
  </body>
</html>
